﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Backend.Data.Managers;
using Backend.Data.Entities;
using System.Diagnostics;

namespace Backend.Data.Tests.Managers
{
    [TestClass]
    public class GeoReferenciaTest
    {



        [TestMethod]
        public void TestGetList()
        {
            var lista = GeoReferenciaManager.GetList();
            Debug.WriteLine("tamanio lista = "+lista.Count);
            Assert.IsTrue(lista.Count > 0);
        }

        [TestMethod]
        public void TestGetGeoReferenciaById()
        {
            Guid idParent = new Guid("826D3978-4A09-E511-805A-64510602C72A");
            GeoReferencia g = GeoReferenciaManager.GetById(idParent);
            Debug.WriteLine("  GeoReferencia " + g.Id);
        }


        [TestMethod]
        public void TestCreate()
        {
            Guid idLegalEntity = new Guid("826d3978-4a09-e511-805a-64510602c72a");

            LegalEntity le = LegalEntityManager.GetById(idLegalEntity);

            Debug.WriteLine("  Legal entity -  " + le.Name);

            GeoReferencia d = new GeoReferencia() { 
            LegalEntity = le
            };
            GeoReferenciaManager.Create(d);
        }


        [TestMethod]
        public void TestDelete()
        {
            Guid id = new Guid("65f4d2e6-bb0e-e511-8062-64510602c72a");
            GeoReferenciaManager.Delete(id);
        }

        [TestMethod]
        public void TestUpdate() 
        {
            Guid id = new Guid("65f4d2e6-bb0e-e511-8062-64510602c72a");
            GeoReferencia gr = GeoReferenciaManager.GetById(id);
            GeoReferenciaManager.Update(gr);
        }



    }
}
